import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";


const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "Main",
    component: () =>
      import("@/views/Main.vue"),
    redirect: {
        name: 'Home'
    },
    children:[
        {
            path: "/Home",
            name: "Home",
            component: () =>
            import("@/views/Home.vue"),
        },
        {
            path: "/singer",
            name: "Singer",
            component: () =>
            import("@/views/Singer.vue"),
        },
        {
            path: "/singer-detail",
            name: "SingerDetail",
            component: () =>
            import("@/views/SingerDetail.vue"),
        },
        {
            path: "/user/home",
            name: "userHome",
            component: () =>
            import("@/views/UserHome.vue"),
        },
        {
            path: "/user/music",
            name: "userMusic",
            component: () =>
            import("@/views/UserMusic.vue"),
        },
        {
            path: "/song/play",
            name: "playSong",
            component: () =>
            import("@/views/PlaySong.vue"),
        },
        {
            path: "/mv/detail",
            name: "MVDetail",
            component: () =>
            import("@/views/MVDetail.vue"),
        },
    ]
  },
  {
    path: "/Login",
    name: "Login",
    component: () =>
      import("@/views/Login.vue"),
  }

];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;